/**
 * Generate time : 2011-05-19 16:15:34
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.ce.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCEA7 table comment : 变量
 */
public class ZMCEA7 extends DaoEPBase {

	private String fdKeyId = " "; /* FD_KEY_ID */
	private String fdParentId = " "; /* 父级节点ID */
	private String fdParentTable = " "; /* 父级节点TABLE */
	private String fdNo = " "; /* 变量编号 */
	private String fdName = " "; /* 变量名称 */
	private String fdUnit = " "; /* 单位 */
	private String fdStatus = " "; /* 状态 */
	private String fdType = " "; /* 变量类型 */
	private String fdIsShow = " "; /* 是否显示 */
	private Long fdCycle = new Long(0); /* 采样周期 */
	private String fdDatasourceId = " "; /* 数据源ID */
	private String fdRemarks = " "; /* 备注 */

	private String fdProductionUnitsId = " "; /* 生产单元Id */
	private String fdGroupId = " "; /* 变量组Id */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("父级节点ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentTable");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("父级节点TABLE");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdNo");
		eiColumn.setFieldLength(10);
		eiColumn.setDescName("变量编号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("变量名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdUnit");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("单位");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdStatus");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("状态");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdType");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("变量类型");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsShow");
		eiColumn.setFieldLength(1);
		eiColumn.setDescName("是否显示");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdCycle");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("采样周期");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDatasourceId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("数据源ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRemarks");
		eiColumn.setFieldLength(250);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdProductionUnitsId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("生产单元Id");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdGroupId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("变量组Id");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCEA7() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - FD_KEY_ID
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - FD_KEY_ID
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdParentId - 父级节点ID
	 * 
	 * @return the fdParentId
	 */
	public String getFdParentId() {
		return this.fdParentId;
	}

	/**
	 * set the fdParentId - 父级节点ID
	 */
	public void setFdParentId(String fdParentId) {
		this.fdParentId = fdParentId;
	}

	/**
	 * get the fdParentTable - 父级节点TABLE
	 * 
	 * @return the fdParentTable
	 */
	public String getFdParentTable() {
		return this.fdParentTable;
	}

	/**
	 * set the fdParentTable - 父级节点TABLE
	 */
	public void setFdParentTable(String fdParentTable) {
		this.fdParentTable = fdParentTable;
	}

	/**
	 * get the fdNo - 变量编号
	 * 
	 * @return the fdNo
	 */
	public String getFdNo() {
		return this.fdNo;
	}

	/**
	 * set the fdNo - 变量编号
	 */
	public void setFdNo(String fdNo) {
		this.fdNo = fdNo;
	}

	/**
	 * get the fdName - 变量名称
	 * 
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}

	/**
	 * set the fdName - 变量名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * get the fdUnit - 单位
	 * 
	 * @return the fdUnit
	 */
	public String getFdUnit() {
		return this.fdUnit;
	}

	/**
	 * set the fdUnit - 单位
	 */
	public void setFdUnit(String fdUnit) {
		this.fdUnit = fdUnit;
	}

	/**
	 * get the fdStatus - 状态
	 * 
	 * @return the fdStatus
	 */
	public String getFdStatus() {
		return this.fdStatus;
	}

	/**
	 * set the fdStatus - 状态
	 */
	public void setFdStatus(String fdStatus) {
		this.fdStatus = fdStatus;
	}

	/**
	 * get the fdType - 是否存储
	 * 
	 * @return the fdType
	 */
	public String getFdType() {
		return this.fdType;
	}

	/**
	 * set the fdType - 是否存储
	 */
	public void setFdType(String fdType) {
		this.fdType = fdType;
	}

	/**
	 * get the fdIsShow - 是否显示
	 * 
	 * @return the fdIsShow
	 */
	public String getFdIsShow() {
		return this.fdIsShow;
	}

	/**
	 * set the fdIsShow - 是否显示
	 */
	public void setFdIsShow(String fdIsShow) {
		this.fdIsShow = fdIsShow;
	}

	/**
	 * get the fdCycle - 采样周期
	 * 
	 * @return the fdCycle
	 */
	public Long getFdCycle() {
		return this.fdCycle;
	}

	/**
	 * set the fdCycle - 采样周期
	 */
	public void setFdCycle(Long fdCycle) {
		this.fdCycle = fdCycle;
	}

	/**
	 * get the fdDatasourceId - 数据源ID
	 * 
	 * @return the fdDatasourceId
	 */
	public String getFdDatasourceId() {
		return this.fdDatasourceId;
	}

	/**
	 * set the fdDatasourceId - 数据源ID
	 */
	public void setFdDatasourceId(String fdDatasourceId) {
		this.fdDatasourceId = fdDatasourceId;
	}

	/**
	 * get the fdRemarks - 备注
	 * 
	 * @return the fdRemarks
	 */
	public String getFdRemarks() {
		return this.fdRemarks;
	}

	/**
	 * set the fdRemarks - 备注
	 */
	public void setFdRemarks(String fdRemarks) {
		this.fdRemarks = fdRemarks;
	}

	/**
	 * get the fdProductionUnitsId - 生产单元Id
	 * 
	 * @return the fdProductionUnitsId
	 */
	public String getFdProductionUnitsId() {
		return this.fdProductionUnitsId;
	}

	/**
	 * set the fdProductionUnitsId - 生产单元Id
	 */
	public void setFdProductionUnitsId(String fdProductionUnitsId) {
		this.fdProductionUnitsId = fdProductionUnitsId;
	}

	/**
	 * get the fdGroupId - 变量组Id
	 * 
	 * @return the fdGroupId
	 */
	public String getFdGroupId() {
		return this.fdGroupId;
	}

	/**
	 * set the fdGroupId - 变量组Id
	 */
	public void setFdGroupId(String fdGroupId) {
		this.fdGroupId = fdGroupId;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentId")), fdParentId));
		setFdParentTable(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentTable")), fdParentTable));
		setFdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdNo")), fdNo));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdUnit")), fdUnit));
		setFdStatus(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdStatus")), fdStatus));
		setFdType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdType")), fdType));
		setFdIsShow(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdIsShow")), fdIsShow));
		setFdCycle(NumberUtils.toLong(StringUtils.toString(map.get("fdCycle")), fdCycle));
		setFdDatasourceId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDatasourceId")), fdDatasourceId));
		setFdRemarks(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRemarks")), fdRemarks));

		setFdProductionUnitsId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdProductionUnitsId")), fdProductionUnitsId));
		setFdGroupId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdGroupId")), fdGroupId));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdParentId", StringUtils.toString(fdParentId, eiMetadata.getMeta("fdParentId")));
		map.put("fdParentTable", StringUtils.toString(fdParentTable, eiMetadata.getMeta("fdParentTable")));
		map.put("fdNo", StringUtils.toString(fdNo, eiMetadata.getMeta("fdNo")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));
		map.put("fdUnit", StringUtils.toString(fdUnit, eiMetadata.getMeta("fdUnit")));
		map.put("fdStatus", StringUtils.toString(fdStatus, eiMetadata.getMeta("fdStatus")));
		map.put("fdType", StringUtils.toString(fdType, eiMetadata.getMeta("fdType")));
		map.put("fdIsShow", StringUtils.toString(fdIsShow, eiMetadata.getMeta("fdIsShow")));
		map.put("fdCycle", StringUtils.toString(fdCycle, eiMetadata.getMeta("fdCycle")));
		map.put("fdDatasourceId", StringUtils.toString(fdDatasourceId, eiMetadata.getMeta("fdDatasourceId")));
		map.put("fdRemarks", StringUtils.toString(fdRemarks, eiMetadata.getMeta("fdRemarks")));

		map.put("fdProductionUnitsId", StringUtils.toString(fdProductionUnitsId, eiMetadata.getMeta("fdProductionUnitsId")));
		map.put("fdGroupId", StringUtils.toString(fdGroupId, eiMetadata.getMeta("fdGroupId")));

		return map;

	}
}